package com.dong;

//import com.dong.vedio.UdpVideoReceiver;
import com.dong.vedio.UdpVideoReceiverService;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * Spring Boot 应用启动类
 */

@SpringBootApplication(scanBasePackages = "com.dong") // 显式指定扫描包（可选，默认扫描当前类所在包及子包）
@MapperScan("com.dong.mybatis.mapper") // 若不使用MyBatis操作数据库，直接注释或删除此句
public class Main {

    public static void main(String[] args) {
        // 启动Spring Boot应用，返回应用上下文
        ConfigurableApplicationContext context = SpringApplication.run(Main.class, args);
        // 可选：验证UdpVideoReceiver是否被Spring容器管理（用于调试）
        try {
            // 从容器中获取UdpVideoReceiver实例，若能获取则说明扫描成功
            UdpVideoReceiverService receiver = context.getBean(UdpVideoReceiverService.class);
            System.out.println("UdpVideoReceiver已被Spring容器成功加载");
        } catch (Exception e) {
            System.err.println("UdpVideoReceiver未被Spring容器扫描到，请检查包路径是否正确");
        }
    }
}